package cn.good.biz.controller;

import cn.good.biz.service.GDArticleTypeService;
import cn.good.dto.Dto;
import cn.good.dto.DtoUtil;
import cn.good.pojo.ArticleType;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/doc/articletype")
public class ArticleTypeController {

    @Resource
    private GDArticleTypeService gdArticleTypeService;


    @ApiOperation(value="查询文章标签",httpMethod = "POST",
            protocols = "HTTP", produces = "application/json",
            response = Dto.class,notes="查询文章标签")
    @RequestMapping("/articletype")
    public Dto selectArticleTypeList(){
        List<ArticleType> list=null;

        try {
            list=gdArticleTypeService.findTypeList();
            return DtoUtil.returnDataSuccess(list);
        } catch (Exception e) {
            e.printStackTrace();
            return DtoUtil.returnFail("获取文章标签失败","20011");
        }
    }
}
